# 九九乘法表
# for循环
for i in range(1,10):
	for j in range(1,i+1):
		print('{}x{}={:<4}'.format(j,i,i*j),end = ' ')
	print('')

for i in range(9,0,-1):
	for j in range(1,i+1):
		print('{}x{}={:<4}'.format(j,i,i*j),end = ' ')
	print('')

for i in range(1,10):
	for k in range(1,10-i):
		print(end = '         ')
	for j in range(1,i+1):
		print('{}x{}={:<4}'.format(j,i,i*j),end = ' ')
	print('')

for i in range(9,0,-1):
	for k in range(1,10-i):
		print(end = '         ')
	for j in range(1,i+1):
		print('{}x{}={:<4}'.format(j,i,i*j),end = ' ')
	print('')

# while循环
i = 1
while i<=9:
	j = 1
	while j<=i:
		print('{}x{}={:<4}'.format(j,i,i*j),end = ' ')
		j+=1
	i+=1
	print('')

i = 9
while i>=1:
	j = 1
	while j<=i:
		print('{}x{}={:<4}'.format(j,i,i*j),end = ' ')
		j+=1
	i-=1
	print('')

i = 1
while i<=9:
	k = 1
	while k <= (9-i):
		print(end = '         ')
		k+=1
	j = 1
	while j<=i:
		print('{}x{}={:<4}'.format(j,i,i*j),end = ' ')
		j+=1
	i+=1
	print('')

i = 9
while i>=1:
	k = 1
	while k <= (9-i):
		print(end = '         ')
		k+=1
	j = 1
	while j<=i:
		print('{}x{}={:<4}'.format(j,i,i*j),end = ' ')
		j+=1
	i-=1
	print('')








